Method and system for controlling the execution of an application program

ABSTRACT

A method and system for controlling the execution of an application program to effect the performing of a specialized task is provided. In preferred embodiments, an interface computer program gathers status information from the application computer program, collects user input relating to the specialized task, generates commands to send to the application program, and sends the commands to the application program to effect the execution of the specialized task. The interface computer program communicates with the application computer program preferably through the dynamic data exchange of Windows.

This is an con of Ser. No. 07/764,706 Sept. 24, 1991 U.S. Pat. No. 5,301,326.

TECHNICAL FIELD

This invention relates generally to methods for controlling the execution of an application program, and more specifically a method and system for providing a user interface for controlling the performing of specialized tasks by the application program.

BACKGROUND OF THE INVENTION

There currently exists a plethora of general-purpose application computer programs. These general-purpose application programs include word processors, desk top publishers, spreadsheets, and data base products. The field is very competitive for producing these products. When these general-purpose application programs were first developed for personal computers, they were unsophisticated by today's standards. Due in part to competitive pressures, these programs evolved into very sophisticated programs that provide many features and options. For example, the original spreadsheet products basically provide a grid of cells for numerical calculations. Spreadsheet products today provide many more capabilities such as graphing data, storing and retrieving data, and programming functions.

Unfortunately, as these general-purpose application programs get more sophisticated, the user also needs to be more sophisticated to take advantage of advanced features. These advanced features often make tasks that were previously simple more complicated to perform. Consequently, users must devote a considerable amount of time to learning the product to perform these previously simple tasks. This complexity also affects the efficiency of tasks that are performed for the first time on an infrequent basis. For example, a user may want to quickly produce a quarterly newsletter using a desktop publishing product, but the user may not have design skills or skills in using all the necessary parts of the application. Also, a user may produce a quarterly newsletter using a desktop publishing product. However, the user may forget how to use many of the features of the publisher in between issues of the newsletter. Thus, the user must spend a certain amount of re-learning time each quarter.

A feature that has recently been added to several general-purpose computer programs is interprocess communications. Interprocess communications allows computer programs to transmit data to each other through communications channels. Interprocess communications has typically been used to synchronize programs, to request data from a program, and send data to a program. Microsoft Corporation has developed a standard interprocess communications mechanism for application programs. The mechanism is called the Dynamic Data Exchange (DDE). The DDE provides a means for interprocess communications for programs that are developed for the Windows windowing environment. The DDE feature of Windows is described in the “Microsoft Systems Journal,” November, 1987 and the “Microsoft Windows Programmer's Reference.” The DDE is implemented through message passing. The DDE is typically used to allow two application programs to share data. For example, a user may want to incorporate a quarterly chart that is developed in a graphics package into a newsletter. Using DDE, the publisher product could request a new chart to be generated by the graphics product. The publisher product could then automatically incorporate the new chart into the current newsletter. The DDE thus provides a mechanism for one program to share and update data with another program.

Typically, developers of application programs that use the DDE will publish their DDE interface. For example, the developer of a spreadsheet product will publish a list of messages that it will recognize and how it will respond to those messages. Some general-purpose application programs define these messages so that each function that can be accomplished through the user interface to the application program can be accomplished through the DDE.

It would be desirable to have an easy-to-use method and system for using theses sophisticated general-purpose programs.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide a method and system for performing a specialized task in a general-purpose application program.

It is another object of the present invention to provide a new user interface to a preexisting application program to control the execution of a task.

It is another object of the present invention to provide a method and system that allows third parties to extend and customize the features of an existing application program.

It is another object of the present invention to provide an interface program that has expert knowledge relating to the performance of a specialized task.

It is another object of the present invention to provide a system architecture for the performing of specialized task in an application program.

These and other objects, which will become apparent as the invention is more fully described below, are obtained by a method and system for controlling the execution of an application program to effect the performing of a specialized task. In preferred embodiments, an interface computer program gathers status information from the application computer program, collects user input relating to the specialized task, generates commands to send to the application program, and sends the commands to the application program to effect the execution of the specialized task.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1A is a block diagram of an application program and an interface program.

FIG. 1B illustrates a user interface program that interacts with two application programs.

FIG. 2 is a flow diagram of typical communication sequence between an interface program and an application program

FIG. 3 shows a display for the Calendar PageWizard.

FIG. 4 is a flow diagram of the main window procedure for a PageWizards.

FIGS. 5A, 5B, and 5C are flow diagrams of the message processing procedure for the PageWizard main window.

FIG. 6 is a flow diagram of the procedure GoPage.

FIGS. 7A, 7B, and 7C are a flow diagrams of a preferred window procedure for a page.

FIG. 8 is a flow diagram of the AskPublisher procedure.

FIG. 9 is a flow diagram of the TellPublisher procedure.

DETAILED DESCRIPTION OF THE INVENTION

The present invention provides methods for implementing a user interface to one or more application programs. According to the methods, an interface program interacts with an application program and a user to effect the performance of a desired task. An interface program is referred to as a wizard. For example, in one embodiment of the present invention, several user interface programs, called PageWizards, provide new user interfaces to a desktop publishing application program, called Publisher. Each PageWizard provides a user interface to perform a specific task with the Publisher. One such PageWizard, called Calendar PageWizard, supports creating calendars. The Calendar PageWizard collects formatting and date information from the user. The Calendar PageWizard interacts with the Publisher to effect the creation of a calender by Publisher.

FIG. 1A is a typical block diagram of an application program 102 and an interface program 101. The programs communicate through interprocess communications channel 105. In a preferred embodiment, interprocess communications channel is the Dynamic Data Exchange (DDE) of Windows. However, other methods of interprocess communications are acceptable. The interface program 101 comprises a user interface portion 104 and an application interface portion 103. The user interface portion 104 provides the user with a task-specific interface. In the example of Calendar PageWizard, the tasks is to use the Publisher to create calendars. The user interface displays calendar information to the user and collects formatting data from the user. The application interface, portion 103 prepares commands to send to the application program 102 and controls communications with the application program 102. Alternatively, an interface program may interact with-several application programs to effect a specific task. For example, a user interface program may support a mail merge. Such a user Interface program could interact with a data base application program and a word processing application program. The mail merge interface program would collect names and addresses from the data base product based on user-entered criteria and send the data to a word processing program to merge with a user-entered document. FIG. 1B illustrates a user interface program that interacts with two application programs. The interface program 111 has a user interface portion 114 and two application interface portions 115, 116. Each application interface portion interfaces with one of the application programs 112, 113 through one of the interprocess communications channels 117, 118.

FIG. 2 is a flow diagram of typical communication sequence between an interface program and an application program. The blocks in the right column 210 represent processing that is performed by the application program. The blocks in the left column 220 represent processing that is performed by the interface program. Initially, the application program is started. The user of the application program selects to start the interface program. In block 211, the application programs starts the selected interface program. In other embodiments, the user could start an interface program which would then start the application program or both the application program and the interface program could be started independently of each other. In block 221, the interface program creates status commands. These status commands request the application program to send status information to the interface program. In block 222, the interface program sends the status commands to the application program. In block 212, the application program processes the status commands. In block 213, the application 25 program sends the status to the interface program. In block 223, the interface program inputs data from the user describing the task to be performed. In block 224, the interface program creates task commands to perform the desired task. In block 225, the interface program sends 30 the task commands to the application program. In block 214, the application program executes the task commands.

In a preferred embodiment, the application program and interface program operate in the Windows windowing environment. The interface program provides 35 windows through which to display information to the user and receive information from the user. FIG. 3 shows a display for the Calendar PageWizard, which interfaces with the Publisher application program. PageWizards interface with the user through a series of “pages.” The user “navigates” through these pages to input and view data. Window 301 is the main Publisher window. Window 302 is the main PageWizard window, which overlays window 301. Window 302 comprises page-specific controls 303, a graphic item 304, and main navigation controls 305. The main navigation controls 305 allow the user to select the various pages that the Calendar PageWizard provides. The “Next >” control 306 indicates to go to the next page. The “<” control 307 indicates to go to the previous page. The “|<<” control 308 indicates to go to the first page. The “Cancel” control 309 indicates to exit the Calendar PageWizard and return to the Publisher.

The pages are defined in a page resource file with user-defined resources. For each page, the resource file contains the following information:

PAGEn

PAGE

BEGIN NextPageNum, cControls,

control information,

control information,

. . .

control information,

END

where n in PAGEn specifies the page number, NextPageNum specifies the page to be displayed when the next page is selected, and cControls is the count of the control information lines that follow. The format of the control information lines is

controltype, text, id, x, y, width, height, nextpage

where the format is same as the standard dialog controls except for the item nextpage. The item nextpage specifies the next page to go to when the control is selected. This allows the navigation sequence of the pages to vary based on the control the user selects.

The graphics for the pages are defined in a resource file with user-defined resource items. There are two types of graphic items: a metafile and a text object. Each graphic item has an entry in the graphics resource file. The format for the metafile entry is

GRNAME METAFILE grname.wmf GRNAME BOUNDS BEGIN x, y, width, height END

where grname.wmf specifies the name of the associated metafile (each metafile is stored in a separate file) and variables x, y, width, and height specify the positioning of the metafile on the page. The format for a text object entry is

TXNAME

TEXTOBJECT

BEGIN

stringID, x, y, width, height,

fontname, ptsize., fontstyle,

R1, G1, B1, R2, G2, B2,

fBorder, leftindent, rightident, align

END

where stringID contains the id of a string that is stored in a string resource file. The string resource file contains stringID and the associated text string. The other variables define the position and display characteristics of the string.

In a preferred embodiment, all wizards that interact with a certain application program share common architectural features. For example, all wizards that interface with the Publisher use pages as described above. A PageWizard has a main window procedure and a window procedure for each page. The main window procedure sends messages to the pages to control the navigation through the pages. FIG. 4 is a flow diagram of the main window procedure for a PageWizards. In block 401, the procedure opens the communications channel with the application program. In another embodiment, the communications channel is opened just before the first communications data is sent. In block 402, the procedure initializes an internal data structure with display information from the resource files. In block 403, the procedure requests and receives status information from the application program. In block 404, the procedure creates the main window. In blocks 405 and 406, the procedure executes the main message loop. The procedure waits for a message and then dispatches the message.

FIGS. 5A, 5B, and 5C are flow diagrams of the main window procedure for the PageWizard. This procedure displays the main window, processes the termination character, controls the navigation through the pages, and handles other miscellaneous windowing functions. Blocks 510, 520, 530, 540, 550, and 560 decode the message. In block 510, if the message is a WM_CREATE, then the procedure displays the main window in block 511 through 513. In block 511, the procedure adjusts the system menu by removing non-applicable menu commands and adding an “Abort . . . ” menu command. In block 512, the system determines the appropriate font based on the video configuration, and then scales the size of the main PageWizard window based on the size of this font. In block 513, the procedure displays the main window and returns. In block 520, if the message is WM_CHAR, then the procedure continues at block 521. In block 521, if the WM_CHAR message indicates that the escape key was pressed, then the procedure effects the exiting of the PageWizard. In block 530, if the message is a WM_COMMAND, a WM_ENTERPAGE, or a WM_LEAVEPAGE message, then the procedure continues at block 531. In block 531, if the message is for a main navigation control, then the procedure continues at block 535, else the procedure continues at block 532. In block 532, the procedure passes the message to the window procedure for the page currently displayed. Each page has a corresponding window procedure to handle the messages for that page. In block 533, the procedure updates a variable to track the current page. In block 534, the procedure enables or disables the navigation controls to reflect whether there is no next page or no previous page and returns. In block 535, the procedure calls procedure GoPage (described below), which effects the switching of pages and returns. In block 540, if the message is WM_PAINT, then the procedure continues at block 541. In block 541, the procedure paints the main Pagewizard window and returns. In block 550, if the message is WM_CLOSE, then the procedure continues at block 551. In block 551, the procedure exits the PageWizard. In block 560, if the message is WM_SYSCOMMAND, then the procedure continues at block 561. In block 561, the procedure displays the about dialog box and returns.

FIG. 6 is a flow diagram of the procedure GoPage. This procedure receives a-page number and effects the changing from the current page to the received page. In block 601, if the received page number is valid, then the procedure continues at block 602, else the procedure returns. A page number is valid if it is defined in the page resource file. In block 602, the procedure sends a WM_LEAVEPAGE message to the previous page. In block 603, the procedure saves the previous page in a list of previous pages. This list is used to navigate through previous pages. In block 604, the procedure destroys the controls of the previous page. In block 605, the procedure creates the controls for the new page. In block 606, the procedure sends a WM_ENTERPAGE message to the window procedure for the new page.

FIGS. 7A, 7B, and 7C are flow diagrams of a preferred window procedure for a page. In a preferred embodiment, the page windows are architecturally similar in the way they handle navigation controls. In block 710, if the message is WM_ENTERPAGE, then the procedure continues at block 711. The WM_ENTERPAGE message is sent from the procedure GoPage. In block 711, the procedure draws the graphics objects for the page. In block 712, the procedure initializes the controls. In block 713, the procedure perform page-specific initialization and returns. In block 720, if the message is WM_COMMAND, then the procedure continues at block 721. The WM_COMMAND message is sent from the procedure GoPage. In block 721, the procedure updates page-specific controls. In block 722, the procedure updates page-specific graphics. In block 723, the procedure performs page-specific processing and return. In block 730, if the message is WM_LEAVEPAGE, then the procedure continues at block 731. The WM_LEAVEPAGE message is sent by the procedure GoPage. In block 731, the procedure validates the user-entered page data. In block 732, the procedure removes page-specific graphics from the display. In block 733, the procedure performs page-specific processing and returns.

In a preferred embodiment, the application interface portion of the interface program controls the gathering of status information from the application program, the creating of task commands, and the sending of the task commands to the application program. The application interface code creates the task commands based on the user-entered information and status information supplied by the application program. For Calendar PageWizards, the application interface generates task commands to create a calendar in the Publisher based on the user data and designs built into Calendar PageWizards. The user data specifies size, font, date, arrangement, and other options for calendar creation.

In a preferred embodiment, the application interface communicates with the application program through the dynamic data exchange (DDE) facilities of Windows. The interface program functions as a DDE client to the application program, which functions as a DDE server. The interface program initiates a conversation with the application program by sending a DDE_INITIATE message specifying the application and topic. The application program responds with a DDE_ACK message. To request status information, the interface program sends a DDE_REQUEST message with the item to the application program. The application program responds with a DDE_DATA message with the requested item. The interface program sends a request for each item it needs from the application program. The interface program sends commands to the application program by sending a DDE_EXECUTE message with the command to the application. The application program returns a DDE_ACK message when it completes processing the command. If the interface program interacts with multiple application programs, then this communications occurs with each application program.

FIGS. 8 and 9 show flow diagrams of procedures that support the DDE communications in PageWizards. FIG. 8 is a flow diagram of the AskPublisher procedure. The AskPublisher procedure opens the DDE channel if not already open and requests status information from the Publisher. This procedure receives as input parameter the item to request from the Publisher. In block 801, if the DDE channel is not open, then the procedure opens the channel in block 802 (as described above) and continues at block 803. In block 803, the procedure sends a DDE_REQUEST message with the item to the Publisher. In block 804, the procedure waits for a DDE_DATA or DDE_ACK message to be received from the Publisher. This waiting ensures that Publisher will process the request before AskPublisher returns to the invoking routine. In block 805, if the DDE_ACK message indicates an error, then the procedure reports the status to the user in block 806. The procedure then returns.

FIG. 9 is a flow diagram of the TellPublisher procedure. The TellPublisher procedure opens the DDE channel if not already open and send commands to execute to the Publisher. This procedure receives as input parameter the command to send to the Publisher. In block 901, if the DDE channel is not open, then the procedure opens the channel in block 902 (as described above) and continues at block 903. In block 903, the procedure sends a DDE_EXECUTE message with the item to the Publisher. In block 904, the procedure waits for the DDE_ACK message to be received from the Publisher. This waiting ensures that Publisher will process the command before TellPublisher returns. In block 905, if the DDE_ACK message indicates an error, then the procedure reports the status to the user in block 906 and returns.

Although the methods and systems of the present invention have been disclosed and described with respect to preferred embodiment, it is not intended that the present invention be limited to such embodiments. Rather, the present invention is intended to include all legally equivalent embodiments. Modifications within the spirit of the invention will be apparent to those skilled in the art. The scope of the present invention is defined by the claims that follow. 

We claim:
 1. A method for performing a desired task in an application computer program, the application computer program having a plurality of commands for controlling execution of the application computer program, the method comprising the computer-implemented steps of: executing the application computer program; executing an interface computer program concurrently with the execution of the application computer program wherein the interface computer program can be started and executed independently of the application computer program; under control of the interface computer program, displaying a plurality of input pages in a predefined sequence, each input page having page-specific controls; receiving user input via the page-specific controls; generating status commands for requesting that status information for the application computer program be sent from the application computer program to the interface computer program; and sending the generated status commands to the application computer program; under control of the application computer program, receiving the sent status commands; processing the received status commands to gather status information; and sending the gathered status information to the interface computer program; under control of the interface computer program, receiving the sent status information; receiving a user request from a user of the interface computer program to perform the desired task, the user request comprising data describing the desired task to be performed; identifying task commands of the application computer program based on the received status information and the received user request that when executed effect performing of the desired task; and sending the identified task commands to the application computer program; and under control of the application computer program, receiving the sent task commands; and executing the received task commands to effect the performing of the desired task.
 2. The method of claim 1 wherein the steps of sending the generated status commands, receiving the sent status information, and sending the task commands use an interprocess communication mechanism.
 3. The method of claim 1 wherein the application program has a predefined user interface and the interface computer program provides a specialized user interface adapted to receive the user request.
 4. The method of claim 1 wherein the interface program and the application program execute in a windowing environment.
 5. The method of claim 1 wherein the step of identifying task commands includes determining an order in which the identified task commands are to be executed by the application computer program and wherein the step of sending the identified task commands sends the identified task commands in the determined order.
 6. A computer-readable medium having computer-executable instructions for performing the steps recited in claim
 1. 7. The method of claim 1, wherein the application computer program is a computer program for creating a calendar, and wherein the user request comprises formatting data and date data to perform the desired task of creating the calendar.
 8. The method of claim 7, wherein the formatting data comprises size, font, and arrangement.
 9. A method in an interface computer program for controlling the execution of an application computer program to effect performing of a specialized task, the application computer program having an interprocess communications interface through which commands are received to control the performance of the specialized task, the method comprising the computer-implemented steps of: starting execution of the application computer program independently of the interface computer program; receiving an indication from a user that the specialized task is to be performed; and in response to receiving the indication, displaying a plurality of input pages; each input page having page-specific controls; receiving data necessary to effectuate performance of the specialized task via the page-specific controls; identifying commands of the application program to effect the performance of the specialized task based on the received status information; and sending the identified commands to the application computer program through the interprocess communications interface to effect the controlling of the execution of the application computer program to perform the specialized task.
 10. The method of claim 9 wherein the interprocess communications interface is an interprocess communication mechanism.
 11. A method to provide a wizard associated with an application computer program to execute a desired task, the method comprising the steps of: executing the wizard, in response to a request to perform the desired task within the application computer program, wherein the wizard executes independently from the application program; causing the wizard to collect user input by performing the steps of: displaying a plurality of input pages in a predefined sequence, each input page having a plurality of page-specific controls operable for receiving user input, displayed on each input page, and receiving data necessary to effect the task via the page-specific controls; causing the wizard to generate a task command on the received user input based on the input data; causing the wizard to send the task command to the application computer program; and causing the application computer program to process the task command, thereby executing the desired task.
 12. The method of claim 11, wherein each input page further comprises navigation controls operable to selectably display various ones of the input pages.
 13. The method of claim 11, wherein for each page-specific control on each input page with which the wizard is associated at least one control information line is stored in a single page resource file, wherein each control information line allows for a navigation sequence of the input pages to vary based on the associated page-specific control selected by the user.
 14. The method of claim 11, wherein each input page comprises graphics objects and text objects.
 15. A method for causing an application computer program to execute a desired task, the method comprising the steps of: executing a wizard associated with the application computer program in response to a request to perform the desired task, the wizard comprising a user interface and an application interface; causing the user interface of the wizard to collect user input by performing the steps of: displaying a plurality of input pages, each input page having page-specific controls displayed on the page, and receiving the user input via the page-specific controls; causing the wizard program to generate a task command on the received user input; causing the application interface of the wizard to send the task command to the application computer program; and causing the application computer program to process the task command, thereby executing the desired task. 